package com.media.entrance.config;

import com.alibaba.nacos.api.config.ConfigType;
import com.alibaba.nacos.api.config.annotation.NacosConfigurationProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.context.annotation.Configuration;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Configuration
@NacosConfigurationProperties(prefix = "router-parameters", dataId = "media-router-options", autoRefreshed = true, ignoreInvalidFields = true, type = ConfigType.YAML)
public class MediaRouterOptions {
//    private static MediaRouterOptions instance;

    // 放到redis中 二次缓存
    public long getMaxWaitingLineLimit() {
        return maxWaitinglineLimit;
    }

    public void setMaxWaitingLineLimit(long num) {
        this.maxWaitinglineLimit = num;
    }

    // 最大排队数默认100
    private long maxWaitinglineLimit;

//    public static MediaRouterOptions getInstance() {
//        if (instance == null) {
//            instance = new MediaRouterOptions();
//        }
//        return instance;
//    }
}
